﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class ModelService
    {
        public static IServiceCollection AddModels(this IServiceCollection services)
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            foreach (var type in assembly.GetTypes())
            {
                if (type.FullName.StartsWith("Crawler.Model"))
                    services.AddScoped(type);
            }
            return services;
        }
    }
}
